home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / 3dv.zip / 3DVSETUP.C < prev    next >
C/C++ Source or Header  |  1991-03-21  |  935b  |  46 lines

  1. /****************************************************************\
  2. |  set graphics mode for 3dv
  3. |----------------------------------------------------------------
  4. |  This program applies a patch to the 3dv program in the usgiest
  5. |  possible way. Written by Bill Davidsen for people who have
  6. |  MS-DOS with no DEBUG and need another mode.
  7. \****************************************************************/
  8.  
  9. #include <stdio.h>
  10.  
  11. static void puthelp();
  12.  
  13. main(argc, argv)
  14. int argc;
  15. char *argv[];
  16. {
  17.     int n;
  18.     FILE *fp;
  19.  
  20.     if (argc != 2) puthelp();
  21.  
  22.     n = atoi(argv[1]);
  23.     if (n < 1 || n > 4) puthelp();
  24.  
  25.     fp = fopen("3dv.exe", "r+");
  26.     if (fp == NULL) {
  27.         printf("File 3dv.exe not in currect directory\n");
  28.         exit(1);
  29.     }
  30.  
  31.     fseek(fp, (long)0xcd5, 0);
  32.     putc(n, fp);
  33.     fclose(fp);
  34.  
  35.     exit(0);
  36. }
  37.  
  38. static void
  39. puthelp()
  40. {
  41.     printf("Call with:\n");
  42.     printf("  3dvsetup n\n");
  43.     printf("Where n=1 EGA, 2 CGA hi res, 3 CGA lo res, 4 Hercules\n");
  44.     exit(1);
  45. }
  46.